<template>
  <el-button text @click="dialogFormVisible = true">
   点击 日程安排
  </el-button>

  <el-dialog
    v-model="dialogFormVisible"
    title="添加日程"
    destroy-on-close
    align-center
    :draggable="true"
    width="500px"
  >
    <el-form :model="form">
      <el-form-item label="事件" :label-width="formLabelWidth">
        <el-input v-model="form.name" placeholder="请输入日程安排"/>
      </el-form-item>
      <el-form-item label="紧急性" :label-width="formLabelWidth">
        <el-select v-model="form.region" placeholder="请按情况选择">
          <el-option label="No.1" value="shanghai" />
          <el-option label="No.2" value="beijing" />
        </el-select>
      </el-form-item>
    </el-form>
    <template #footer>
      <span class="dialog-footer">
        <el-button @click="dialogFormVisible = false">取消</el-button>
        <el-button type="primary" @click="dialogFormVisible = false">
          确定
        </el-button>
      </span>
    </template>
  </el-dialog>
</template>

<script lang="ts" setup>
import { reactive, ref } from "vue";

const dialogFormVisible = ref(false);
const formLabelWidth = "100px";

const form = reactive({
  name: "",
  region: "",
});
</script>
<style scoped>
.el-select {
  width: 300px;
}
.el-input {
  width: 300px;
}
.dialog-footer button:first-child {
  margin-right: 10px;
}
</style>
